namespace OracleInternal.Common
{
	internal class CharArrayPooler : SyncQueueList<char[]>
	{
		private int m_charBufSize = 4000;

		internal CharArrayPooler(int maxElements)
			: base(maxElements)
		{
		}

		internal CharArrayPooler(int maxElements, int charBufSize)
			: base(maxElements)
		{
			m_charBufSize = charBufSize;
		}

		internal override char[] Dequeue()
		{
			lock (m_sync)
			{
				if (m_list.Count == 0)
				{
					return new char[m_charBufSize];
				}
				char[] array = m_list[0];
				m_list.Remove(array);
				return array;
			}
		}
	}
}
